source /mnt/sfs/asr/.bashrc

split_num=8
split_data_dir=./input_data/split_tts_scp_$split_num
mkdir -p "$split_data_dir"
data_path=./input_data/tts_test.scp
# 计算每个文件的行数
total_lines=$(wc -l < "$data_path")
output_dir=./output_data/
mkdir -p "$output_dir"
lines_per_file=$(( (total_lines + split_num - 1) / split_num ))
split -l "$lines_per_file" -d -a 1 "$data_path" "$split_data_dir/data_part_"

for i_haha in {0..7}
do
    data_path=$split_data_dir/data_part_$i_haha
    output_token_file=$output_dir/token_scp_$i_haha
    output_wav_file=$output_dir/wav_jsonl_$i_haha
    my_named_nohup do_infer_$i_haha python infer_tts_full.py $data_path $output_token_file $output_wav_file $i_haha
done